package ui.adapter;

import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fy.fyzf.R;
import com.fy.fyzf.bean.DaiKanListBean;

import java.util.List;

public class DaiKanAdapter extends BaseQuickAdapter<DaiKanListBean.HousingFollowsBean, BaseViewHolder> {


    public DaiKanAdapter() {
        super(R.layout.item_with_glass_note);
    }

    public void insertItem(int i) {
        notifyItemInserted(getData().size());
        notifyItemRangeChanged(i, getData().size() - i);
    }

    public void removeItem(int i) {
        getData().remove(i);
        notifyItemRemoved(i);
        notifyDataSetChanged();
    }
    @Override
    protected void convert(BaseViewHolder helper, DaiKanListBean.HousingFollowsBean item) {

        EditText editText = helper.getView(R.id.et_note);
        TextView tvSave = helper.getView(R.id.tv_save);
        TextView tvAdd = helper.getView(R.id.tv_add_note);

        if (helper.getAdapterPosition() == 0) {
            editText.setEnabled(true);
        } else {
            editText.setEnabled(false);
        }
    }

}
